﻿package  {
	
	import flash.display.MovieClip;
	
	
	public class ExpUI extends MovieClip {
		
		private var _maxValue:int=10;
		private var _currentValue:int;
		
		public function ExpUI() {
			// constructor code
			progressMask.scaleX=0;
			greenProgress.mask=progressMask;
		}
		
		private function setProgress():void
		{
			progressMask.scaleX=_currentValue/_maxValue;
			expText.text=_currentValue.toString();
		}
		[Bindable]
		public function get maxValue():int
		{
			return _maxValue;
		}
		[Bindable]
		public function get currentValue():int
		{
			return _currentValue;
		}
		
		public function set maxValue(maxValue:int):void
		{
			this._maxValue=maxValue;
			setProgress();
		}
		
		public function set currentValue(currentValue:int):void
		{
			this._currentValue=currentValue;
			setProgress();
		}
	}
	
}
